determine the intervals when a function is increasing decreasing or constant